import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        System.out.println("体积计算\n请选择要计算的几何体:\n1)三棱柱2)四棱柱3)圆柱体");
        Scanner reader = new Scanner(System.in);
        int select = reader.nextInt();
        if (select == 1) {
            System.out.println("请输入三棱柱的底面三边长和高：");
            double a = reader.nextDouble();
            double b = reader.nextDouble();
            double c = reader.nextDouble();
            double h = reader.nextDouble();
            Sphere obj = new Sphere(a, b, c, h);
            System.out.println("体积为" + obj.getVolume());
            System.out.println("表面积为" + obj.getArea());
        } else if (select == 2) {
            System.out.println("请输入四棱柱的边长(长宽高)：");
            double a = reader.nextDouble();
            double b = reader.nextDouble();
            double c = reader.nextDouble();
            Cube obj = new Cube(a, b, c);
            System.out.println("体积为" + obj.getVolume());
            System.out.println("表面积为" + obj.getArea());
        } else if (select == 3) {
            System.out.println("请输入圆柱的底面半径和高：");
            double br = reader.nextDouble();
            double h = reader.nextDouble();
            Cylinder obj = new Cylinder(br, h);
            System.out.println("体积为" + obj.getVolume());
            System.out.println("表面积为" + obj.getArea());
        }
    }
}